home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / log_tcp_6.0alpha.shar / log_tcp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-02  |  1.5 KB  |  49 lines

  1. /* @(#) log_tcp.h 1.4 93/07/02 16:33:27 */
  2.  
  3. /* Location of the access control files. */
  4.  
  5. #ifndef HOSTS_ALLOW
  6. #define HOSTS_ALLOW    "/etc/hosts.allow"
  7. #endif
  8.  
  9. #ifndef HOSTS_DENY
  10. #define HOSTS_DENY    "/etc/hosts.deny"
  11. #endif
  12.  
  13.  /* Structure filled in by the fromhost() routine. */
  14.  
  15. struct from_host {
  16.     int     sock_type;            /* socket type, see below */
  17.     char   *name;            /* host name */
  18.     char   *addr;            /* host address */
  19.     char   *user;            /* user name */
  20.     struct sockaddr_in *sin;        /* their side of the link */
  21.     void  (*sink)();            /* datagram sink function */
  22. };
  23.  
  24. #define FROM_UNKNOWN    "unknown"    /* name or address lookup failed */
  25. #define FROM_HOST(f) \
  26.     (((f)->name[0] && strcmp((f)->name, FROM_UNKNOWN)) ? (f)->name : (f)->addr)
  27.  
  28. #define FROM_ADDRLEN    (4*3+3+1)    /* string with IP address */
  29.  
  30. /* Socket types: 0 means unknown. */
  31.  
  32. #define FROM_CONNECTED        1    /* connection-oriented */
  33. #define FROM_UNCONNECTED    2    /* non connection-oriented */
  34.  
  35. /* Global functions. */
  36.  
  37. extern int fromhost();            /* get/validate remote host info */
  38. extern int hosts_access();        /* access control */
  39. extern void refuse();            /* refuse request */
  40. extern void shell_cmd();        /* execute shell command */
  41. extern void percent_x();        /* do %<char> expansion */
  42. extern char *rfc931_name();        /* remote name from RFC 931 daemon */
  43. extern char *hosts_info();        /* show origin of connection */
  44. extern void clean_exit();        /* clean up and exit */
  45.  
  46. /* Global variables. */
  47.  
  48. extern int log_severity;        /* for connection logging */
  49.